package MP;

import MP.lexicalanalysis.*;
import MP.syntaxanalysis.*;

public class MPC {
    public static void main(String[] args) {
        String fileName = args[0];
        ErrorReporter reporter = new ErrorReporter();
		try {
			Scanner s = new Scanner(fileName,reporter);
			Parser p = new Parser(s,reporter);
			AST ast = p.parse();
			AstPrinter printer = new AstPrinter();
			printer.print(ast);
		} catch (CompilationException e) {
            reporter.reportError(e.getMessage());
        }
    }
}
